package com.an;

public class FFF {
    public static void main(String[] args) {
        p(new Bell() {
            @Override
            public void ring() {
                System.out.println("懒猪起床了");
            }
        });

        Cellphone cellphone = new Cellphone();
        cellphone.alarmclock(new Bell() {
            @Override
            public void ring() {
                System.out.println("小伙伴上课了");
            }
        });

        cellphone.alarmclock(new Bell() {
            @Override
            public void ring() {
                System.out.println("匿名内部类有点东西");
            }
        });
        cellphone.alarmclock(new Bell(){
            @Override
                    public void ring(){
                System.out.println("啊哈哈哈");
            }
        });

        cellphone.alarmclock(new Bell(){
            @Override
            public void ring(){
                System.out.println("拿捏了!孩子们");
            }
        });


    }
    public static void p(Bell bell){
        bell.ring();
    }
}

interface Bell{
    public void ring();
}

class Cellphone{
    public void alarmclock(Bell bell){
        bell.ring();
    }
}

//
//class Cellphone{
//    public void alarmclock(){
//        //bell.ring
////       Bell. ring(new Bell{
////           @Override
////                   public void ring({
////                System.out.println("起床了");
////            }
////
////        });
//
//
//
//    }
//}